<%@ page import="bean.Record_Bean" %>
<%@ page import="bean.Login" %>
<%@ page import="bean.Users" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>登陆页面</title>
  <link rel="stylesheet" type="text/css" href="css/login.css" />
  <jsp:useBean id = "loginBean" class = "bean.Login" />
</head>
<body>
<div class="login-box">
  <%
    loginBean=(Login) session.getAttribute("loginBean");
    if (loginBean==null){
      loginBean=new Login();
      session.setAttribute("loginBean",loginBean);
    }
  %>
  <jsp:useBean id="userBean" class="bean.Users" scope="request"/>
  <h2>用户登录</h2>
  <form action="HandleLogin" >
    <%
      userBean=(Users)session.getAttribute("userBean");
      if (userBean==null){
        userBean=new Users();
        session.setAttribute("userBean",userBean);
      }
    String userID=userBean.getUserId();
    if (userID==null||userID.equals("")){
    }else {
      out.print(" <a>您已成功注册，您的ID为'"+userID+"'</a><br>");
    }
    %>
    <div class="login-field">
      <input type="text" name="loginID" required="" />
      <label>用户ID</label>
    </div>
    <div class="login-field">
      <input type="password" name="password" required="" />
      <label >密码</label>
    </div><br>
    <button type="submit">登录</button>
    <a href="register.jsp">没有账户，现在注册！</a><br>
    <br>
    <a href="administrator_login.jsp">我是管理员，前往管理员登录</a>
  </form>
</div>
<%--<div>--%>
<%--<jsp:getProperty name="loginBean" property="getBackNews"/>--%>
<%--</div>--%>
</body>

</html>